home *** CD-ROM | disk | FTP | other *** search
Wrap
VERSION 5.00 Begin VB.Form Form1 BackColor = &H00000000& BorderStyle = 3 'Fixed Dialog Caption = "Set Reigion Sample....." ClientHeight = 3810 ClientLeft = 2715 ClientTop = 2325 ClientWidth = 8550 ControlBox = 0 'False LinkTopic = "Form1" MaxButton = 0 'False MinButton = 0 'False ScaleHeight = 3810 ScaleWidth = 8550 ShowInTaskbar = 0 'False Begin VB.CommandButton Command5 Caption = "&Exit" Height = 375 Left = 3360 TabIndex = 14 Top = 3120 Width = 1935 End Begin VB.CommandButton Command4 BackColor = &H00800080& Height = 615 Left = 4920 Style = 1 'Graphical TabIndex = 9 Top = 720 Width = 2055 End Begin VB.CommandButton Command3 Caption = "Set Elliptical Reigion" Height = 375 Left = 4320 TabIndex = 8 Top = 1920 Width = 3375 End Begin VB.CommandButton Command2 BackColor = &H00800080& Height = 615 Left = 720 Style = 1 'Graphical TabIndex = 1 Top = 720 Width = 2055 End Begin VB.CommandButton Command1 Caption = "Set RoundedRectangle Reigion" Height = 375 Left = 120 TabIndex = 0 Top = 1920 Width = 3375 End Begin VB.PictureBox Picture4 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 480 Picture = "frmsetreigion.frx":0000 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 2 Top = 480 Width = 495 End Begin VB.PictureBox Picture3 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 480 Picture = "frmsetreigion.frx":0363 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 3 Top = 1080 Width = 495 End Begin VB.PictureBox Picture6 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 2520 Picture = "frmsetreigion.frx":06C6 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 5 Top = 480 Width = 495 End Begin VB.PictureBox Picture5 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 2520 Picture = "frmsetreigion.frx":0A29 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 4 Top = 1080 Width = 495 End Begin VB.PictureBox Picture1 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 4680 Picture = "frmsetreigion.frx":0D8C ScaleHeight = 465 ScaleWidth = 465 TabIndex = 10 Top = 480 Width = 495 End Begin VB.PictureBox Picture7 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 6720 Picture = "frmsetreigion.frx":10EF ScaleHeight = 465 ScaleWidth = 465 TabIndex = 12 Top = 480 Width = 495 End Begin VB.PictureBox Picture2 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 4680 Picture = "frmsetreigion.frx":1452 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 11 Top = 1080 Width = 495 End Begin VB.PictureBox Picture8 Appearance = 0 'Flat BackColor = &H80000005& ForeColor = &H80000008& Height = 495 Left = 6720 Picture = "frmsetreigion.frx":17B5 ScaleHeight = 465 ScaleWidth = 465 TabIndex = 13 Top = 1080 Width = 495 End Begin VB.Label Label2 BackColor = &H00000000& Caption = "nmohsin@yahoo.com" ForeColor = &H0000C000& Height = 255 Left = 3480 TabIndex = 7 Top = 2880 Width = 2055 End Begin VB.Label Label1 BackColor = &H00000000& Caption = " SoftPhoenix " ForeColor = &H0000C000& Height = 255 Left = 3360 TabIndex = 6 Top = 2640 Width = 2055 End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function CreateEllipticRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long Private Declare Function CreateRoundRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As Rect) As Long Dim RecHandle As Long Dim EllipHandle As Long Private Type Rect nLeftRect As Long ' x-coordinate of the region's upper-left corner nTopRect As Long ' y-coordinate of the region's upper-left corner nRightRect As Long ' x-coordinate of the region's lower-right corner nBottomRect As Long ' y-coordinate of the region's lower-right corner nWidthEllipse As Long ' height of ellipse for rounded corners nHeightEllipse As Long ' width of ellipse for rounded corners End Type Dim lpRect As Rect Private Sub Command1_Click() ' set default region of command2 to roundrectangle SetWindowRgn Command2.hwnd, RecHandle, True End Sub Private Sub Command3_Click() SetWindowRgn Command4.hwnd, EllipHandle, True End Sub Private Sub Command5_Click() Unload Me End Sub Private Sub Form_Load() Dim RecDimention As Long Dim EllipDimention As Long ' get rectacle dimention of command2 button RecDimention = GetClientRect(Command2.hwnd, lpRect) 'create round rectangle reigion RecHandle = CreateRoundRectRgn(lpRect.nLeftRect, lpRect.nTopRect, lpRect.nRightRect, lpRect.nBottomRect, 30, 30) ' get rectacle dimention of command4 button EllipDimention = GetClientRect(Command4.hwnd, lpRect) 'create ellip rectangle reigion EllipHandle = CreateEllipticRgn(lpRect.nLeftRect, lpRect.nTopRect, lpRect.nRightRect, lpRect.nBottomRect) End Sub